package peakIndexInMountainArray;

public class Solution {
    public int peakIndexInMountainArray(int[] arr) {
        // 找最大值
        int l=0,r = arr.length-2;
        while (l<=r) {
            int mid = (l+r)/2;
            if(arr[mid]>arr[mid+1]) {
                r = mid - 1;
            }else {
                l = mid + 1;
            }
        }
        return l;
    }
}
